{template 'common/header'}
<style>
    a:hover {
        color: white;
        text-decoration: underline;
    }
</style>
<script>
    $(function(){
        $(".find").on('click',function(){
            find();
        });
        $(".clear-day").on('click',function(){
            $("#day").val('');
        });
    });
    function find(){
        var server_id = $("#server_id").val();
        var key_word = $("#key_word").val();
        var day = $("#day").val();
        var pay_status = $("#pay_status").val();
        var slow_pay = "{$slow_pay}";
        location.href="{php echo $this->createWebUrl('cashier',array('op' => 'express'))}&server_id="+server_id+"&key_word="+key_word+"&day="+day+"&pay_status="+pay_status+"&slow_pay="+slow_pay;
    }
</script>
<ul class="nav nav-tabs">
    <li ><a href="{php echo $this->createWebUrl('cashier')}">未收款</a></li>
    <li ><a href="{php echo $this->createWebUrl('cashier', array('slow_pay'=>1))}">月结单</a></li>
    <li ><a href="{php echo $this->createWebUrl('cashier', array('op'=>'had_get'))}">未审核已收款</a></li>
    <li {if $slow_pay == 0} class="active" {/if}><a href="{php echo $this->createWebUrl('cashier', array('op'=>'express'))}">服务社</a></li>
    <li {if $slow_pay == 1} class="active" {/if}><a href="{php echo $this->createWebUrl('cashier', array('op'=>'express','slow_pay' => 1))}">服务社月结单</a></li>
</ul>
<div>
    <div class="row">
        <div class="col-xs-3">
            <select class="form-control" id="server_id">
                <option value="0">服务社</option>
                {loop $servers $server}
                <option value="{$server['id']}">{$server['name']}</option>
                {/loop}
            </select>
        </div>
        <!--<div class="col-xs-3">-->
            <!--<input type="text" value="{$key_word}" placeholder="客户名称/电话/助记码" class="form-control" id="key_word" />-->
        <!--</div>-->
        <div class="col-xs-5">
            <div class="col-xs-4">订单日期：</div>
            <div class="col-xs-8"><input type="date" value="{$day}" class="form-control" id="day" /></div>

        </div>
        <div class="col-xs-1">
            <button class="btn btn-default clear-day">清除日期</button>
        </div>
        <div class="col-xs-1">
            <button class="btn btn-primary find">搜索</button>
        </div>
    </div>
    <br />

    {if $server_orders}
    {loop $server_orders $orders}

        <div class="panel panel-primary">
            <div class="panel-heading">
                <div class="panel-title row">
                    <a href="{php echo $this->createWebUrl('cashier',array('op' => 'express_detail','member_id' => $orders['member_id'], 'slow_pay' => $slow_pay,'day' => $orders['day'], 'pay_status' => $pay_status, 'server_id' => $orders['server_id']))}">
                    <div class="col-xs-3">{$orders['server']}{if $orders['server_remark']}({$orders['server_remark']}){/if}</div>
                    </a>
                    <a href="{php echo $this->createWebUrl('cashier',array('op' => 'express_detail','member_id' => $orders['member_id'], 'slow_pay' => $slow_pay,'day' => $orders['day'], 'pay_status' => $pay_status, 'server_id' => $orders['server_id']))}">
                    <div class="col-xs-3">余应收：{$orders['need']}</div>
                    </a>
                    <div class="col-xs-3">
                        <a href="tel:{$orders['phone']}">电话：{$orders['phone']}</a>
                    </div>
                    <a href="{php echo $this->createWebUrl('cashier',array('op' => 'express_detail','member_id' => $orders['member_id'], 'slow_pay' => $slow_pay,'day' => $orders['day'], 'pay_status' => $pay_status, 'server_id' => $orders['server_id']))}">
                    <div class="col-xs-3"><span style="float: right">{$orders['day']}</span></div>
                    </a>

                </div>
            </div>
        </div>
    {/loop}
    {else}
    <div class="alert alert-warning">您该区域还未有未收款</div>
    {/if}
</div>













{template 'common/footer'}